package com.lc.user.express.httpserver;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/3/30.登录
 */
@HttpInlet(Net.GET_LOGIN)
public class GetLogin extends ZJDBAsyGet<GetLogin.Info> {
    public String mobile;

    public GetLogin(String mobile, AsyCallBack listener) {
        super(listener);
        this.mobile = mobile;
    }

    @Override
    protected Info parser(JSONObject object) {
        if (object.optInt("message") == 1) {
            Info info = new Info();
            info.userid = object.optString("userid");
            TOAST = "登录成功";
            return info;
        } else {
            TOAST = "登录失败";
        }
        return null;
    }

    public static class Info {
        public String userid;
    }
}
